package org.grow.ceto.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: xwg
 * @CreateDate: 21-8-29
 */

@RestControllerAdvice
public class ExceptionBridge {
//    默认异常710
//    common异常711
//    player异常712
//    deal异常713

    @ExceptionHandler(CetoException.class)
    public ResponseEntity<String> cetoEx(CetoException e) {
        return  new ResponseEntity<String>(e.getMessage(),null,e.getCode());

    }

    @ExceptionHandler(RuntimeException.class)
    public ResponseEntity<String> otherRuntimeEx(RuntimeException e){
        return  new ResponseEntity<String>(e.getMessage(),null,1024);
    }
}
